// 获取数据，直到获取完毕
const list = [], total = 0
export function getAllData(fun, params, callback) {
  const pagination = {
    pageSize: 10,
    pageNum: 1,
  }

  return new Promise((resolve, reject) => {
    fun({ ...pagination, ...params }).then(res => {
      if (res.code == 200) {
        list.push(...res.rows)
        total = res.total
        if (list.length < total) {
          pagination.pageNum++
          getData(fun, params, callback)
        } else {
          resolve(list)
        }
      } else {
        reject()
      }
    }).catch(err => {
      reject()
    })
  })
}
export const htmlTotext = (html) => {
  if(!html)return ''
  return html.replace(/<[^>]*>/g, ""); //去掉所有的html标记
};